package com.java2_28;

public class java2_28 {
    //    public static void main(String[] args) {
//        //Java中的两种数据类型
//        //基本数据类型
//        //引用数据类型
////
////        int a = 10;
////        System.out.println(a);
//
////        Student student = new Student("zhangsan",20);
////        System.out.println(student);
//
//        //自定义包装类
////        MyInteger integer = new MyInteger(520);
////        //因为将toString重写了
////        System.out.println(integer);
//
//
//
//    }
//    public static void main(String[] args) {
//        //包装类和基本数据类型之间的转换
//        //包装类 -> 基本数据类型
//        //（1）创建对象
//        //Integer integer = new Integer("520");
//
//        //(2)使用基本数据类型转化
////        int a = 10;
////        Integer i = Integer.valueOf(a);
////        System.out.println(i);
//
//        //内部做了相应的处理
////
////        char str = 'a';
////        Character c = Character.valueOf(str);
////        System.out.println(c);
//
////        boolean q = true;
////        Boolean b = Boolean.valueOf(q);
////        System.out.println(q);
////
////        //包装类转化成基本数据类型
////
////        boolean b1 = b.booleanValue();
////        System.out.println(b1);
//
//        //自动封拆包 -- 本质还是包装类.valueOf()，Xxxvalue();
////        int a = 10;
////        Integer i = a;
////        System.out.println(i);
////
////        char str = 'Z';
////        Character character = str;
////        System.out.println(character);
//
//
//    }
//    public static void main(String[] args) {
//        //与字符串的转换
//        //转字符串
////        int number = 100;
////        String s = String.valueOf(number);
////        System.out.println(s);
//
////        double doubleNumber = 3.14159;
////        String s = String.valueOf(doubleNumber);
////        System.out.println(s);
//
//        //()里面填那种类型都可以
//
////        Integer i = 520;
////        String s = String.valueOf(i);
////        System.out.println(s);
//
//
//        //直接加上“”
//
////        float floatNumber = 3.14f;
////        String str = floatNumber + "";
////        System.out.println(str);
//
////        Boolean myBoolean = false;
////        String s = String.valueOf(myBoolean);
////        System.out.println(s);
//
////        Boolean myBoolean = false;
////        String str = myBoolean + "";
////        System.out.println(str);
//
//        //转换成基本数据类型
////        String str = "123456";
////        int i = Integer.parseInt(str);
////        System.out.println(i);
////
////        String str1 = "3.14159";
////        double v = Double.parseDouble(str1);
////        System.out.println(v);
//
//
//    }
//    public static void main(String[] args) {
////        Integer i1 = 1;
////        Integer i2 = 1;
////        System.out.println(i1 == i2); //true
//        //直接从数组中取
//
////        Integer i1 = 128;
////        Integer i2 = 128;
////        System.out.println(i1 == i2); //false
//        //创建新的对象
//
////
////        Integer i = 1000;
////        double d = 1000;
////        System.out.println(i == d); //true
//
//        //包装类 <-> 基本数据类型 <-> String
//
//    }
//    public static void main(String[] args) {
//        //多态
////        People people = new Man("zhangsan", 24);
////        //调用不了子类的特有方法
////        //people.sleep();
//////        Man people1 = (Man) people;
//////        people1.sleep();
////
////        if(people instanceof Man peo){
////            peo.sleep();
////        }
//
//        Man man = new Man("zhangsan",24);
//        work(man);
//    }
//    public static void work(People people){
//        //方法看右边
//
//        people.sleep();
//    }

    public static void main(String[] args) {
        //枚举类
//        MyEnumerate redbird = MyEnumerate.REDBIRD;
//        MyEnumerate yellowbird = MyEnumerate.YELLOWBIRD;
//        MyEnumerate bluebird = MyEnumerate.BLUEBIRD;
//        System.out.println(redbird);
//
//        MyNnum redbird = MyNnum.REDBIRD;
//        System.out.println(redbird);
//        System.out.println(MyNnum.BLUEBIRD);


    }


}
